import { createStore } from 'vuex'

// 引入子模块
import index from './moudles'

const state = {
  count: 0
}
const actions = {
  add({commit,state}){
    commit('increment',++state.count)
  }
}
const mutations = {
  increment (state,value) {
    state.count = value
  }
}
// 创建一个新的 store 实例
const store = createStore({
  state,
  actions,
  mutations,
  modules:{
    index,
  }
})

export default store